package com.sc.nft.admin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.annotation.UserLogin;
import com.sc.nft.dto.AuctionDataDetailsDTO;
import com.sc.nft.entity.dto.AuctionConsumeAdminPageDTO;
import com.sc.nft.entity.dto.AuctionConsumeUserDetailAdminPageDTO;
import com.sc.nft.entity.dto.AuctionRecordAdminDTO;
import com.sc.nft.entity.dto.AuctionUserBiddingAdminPageDTO;
import com.sc.nft.entity.vo.*;
import com.sc.nft.pool.UserPool;
import com.sc.nft.service.DigitalCollectionProductInfoAuctionService;
import com.sc.nft.service.DigitalCollectionProductInfoAuctionUserBiddingService;
import com.sc.nft.service.DigitalCollectionProductInfoAuctionUserConditionService;
import com.sc.nft.sup.PageRequest;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱梦晨
 * @Description:
 * @date 2024-09-06
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/auction")
@Api(tags = "后台竞拍记录模块")
public class DigitalCollectionProductInfoAuctionController {


    private final DigitalCollectionProductInfoAuctionService digitalCollectionProductInfoAuctionService;

    private final DigitalCollectionProductInfoAuctionUserBiddingService digitalCollectionProductInfoAuctionUserBiddingService;

    private final DigitalCollectionProductInfoAuctionUserConditionService digitalCollectionProductInfoAuctionUserConditionService;



    @ApiOperation(value = "后台拍卖记录列表", notes = "后台拍卖记录列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/records", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AuctionRecordAdminPageVO> getAuctionRecordAdminPage(@RequestBody AuctionRecordAdminDTO auctionRecordAdminDTO) {
        return PageResult.success(digitalCollectionProductInfoAuctionService.getAuctionRecordAdminPage(auctionRecordAdminDTO));
    }


    @ApiOperation(value = "后台拍卖记录汇总数据", notes = "后台拍卖记录汇总数据", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/auctionDataDetails", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<AuctionDataDetailsVO> auctionDataDetails(@RequestBody AuctionDataDetailsDTO auctionDataDetailsDTO) {
        return PageResult.success(digitalCollectionProductInfoAuctionService.auctionDataDetails(auctionDataDetailsDTO.getProductId()));
    }


    @ApiOperation(value = "投标用户列表", notes = "投标用户列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/getAuctionUserBiddingAdminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AuctionUserBiddingAdminPageVO> getAuctionUserBiddingAdminPage(@RequestBody AuctionUserBiddingAdminPageDTO auctionUserBiddingAdminPageDTO) {
        return PageResult.success(digitalCollectionProductInfoAuctionService.getAuctionUserBiddingAdminPage(auctionUserBiddingAdminPageDTO));
    }


    @ApiOperation(value = "消耗藏品总数列表  or  消耗门槛藏品总数列表", notes = "消耗藏品总数列表  or  消耗门槛藏品总数列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/getAuctionConsumeAdminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AuctionConsumeAdminPageVO> getAuctionConsumeAdminPage(@RequestBody AuctionConsumeAdminPageDTO auctionConsumeAdminPageDTO) {
        return PageResult.success(digitalCollectionProductInfoAuctionUserBiddingService.getAuctionConsumeAdminPage(auctionConsumeAdminPageDTO));
    }



    @ApiOperation(value = "用户消耗总数详情列表", notes = "用户消耗总数详情列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/getAuctionConsumeUserDetailAdminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AuctionConsumeUserDetailAdminPageVO> getAuctionConsumeUserDetailAdminPage(@RequestBody AuctionConsumeUserDetailAdminPageDTO auctionConsumeUserDetailAdminPageDTO) {
        return PageResult.success(digitalCollectionProductInfoAuctionUserBiddingService.getAuctionConsumeUserDetailAdminPage(auctionConsumeUserDetailAdminPageDTO));
    }

}
